from requests import sessions

from commons.global_info import dict_var, base_url
from utils.replace_both import var_replace_value


class Note:
    """我的笔记"""
    def __init__(self):
        self.session=sessions.Session()
    def add_note(self,method,url,**kwargs):
        if "{" in url:
            url=base_url+var_replace_value(url)
        return self.session.request(method,url,**kwargs)
    def get_note(self,method,url:str,**kwargs):
        if "{" in url:
            url=base_url+var_replace_value(url)
        print(method, url, kwargs)
        return self.session.request(method,url,**kwargs)
    def delete_note(self,method,url,**kwargs):
        if "{" in url:
            url=base_url+var_replace_value(url)
        print(method, url, kwargs)
        return self.session.request(method,url,**kwargs)